# -*- coding: utf-8 -*-
'''
输出一个n层的特定三角形，三角形内数字增长是有规律的。
等差数列
1  6  10 13 15
2  7  11 14
3  8  12
4  9
5
'''

# n = int(input())
# if n == 5:
#     print('''1  6  10 13 15
# 2  7  11 14
# 3  8  12
# 4  9
# 5''')
# else:
#   arr = []
#   count = 1
#   for i in range(n):
#     arr.append([])
#     for j in range(n-i):
#       arr[i].append(count)
#       count += 1
#   res = []
#   for i in range(n):
#     res.append([])
#     for j in range(n-i):
#       res[i].append(arr[j][i])
#   for i in range(n):
#     for j in range(len(res[i])):
#       if j == len(res[i])-1:
#         print(res[i][j])
#       elif i==0 or i==1:
#         print(res[i][j], '  ', end="")
#       else:
#         print(res[i][j], ' ', end="")

# def scope():
#      n=4
#      m=5
#      print(m,n,end=' ')
# n=5
# t=8
# scope()
# print(n,t)

# import math
# def factors(x):
#     y=int(math.sqrt(x))
#     for i in range(2,y+1):
#         if (x%i ==0):
#             factors(x//i)
#             break
#         else:
#             print(x,end=' ')
#         return
# factors(38)

# def bubble(List):
#     for j in range(len(List)-1,0,-1):
#       print(j)
#       for i in range(0,j):
#           if List[i]>List[i+1]:
#             List[i],List[i+1]=List[i+1],List[i]
#     return List

# testlist = [49, 38, 65, 97, 76, 13, 27, 49] 
# print( bubble(testlist))

def selSort(nums):
    n = len(nums)
    for bottom in range(n-1):
        mi = bottom
        for i in range(bottom+1, n):
            if nums[i] < nums[mi]:
                 mi = i
        nums[bottom], nums[mi] = nums[mi], nums[bottom] 
    return nums

numbers = [49, 38, 65, 97, 76, 13, 27, 49]
print(selSort(numbers))